package Ejercicios;

import java.io.*;

/**
 * Lee un Archivo y Verifica si el verso es rima.
 */

public class Rimas {
   public static void main(String[] args)  {
     try {
       File f = new File("rimaonorima.txt");
       FileReader fr = new FileReader(f);
       BufferedReader br = new BufferedReader(fr);
         String cad1 = br.readLine();
         String cad2 = br.readLine();
         String cad3 = br.readLine();
         String cad4 = br.readLine();
           System.out.println(cad1);
           System.out.println(cad2);
           System.out.println(cad3);
           System.out.println(cad4);
            if(cad1.endsWith(cad3.substring(cad3.length()-3, cad3.length()))&&cad2.endsWith(cad4.substring(cad4.length()-3, cad4.length()))){
              System.out.println("Si son rimas");
            }
            else{
                System.out.println("No son rimas");
            }
      } catch (Exception ex) {
           System.out.println("Excepcion");
        }

    }
}